import request from '@/utils/request'

export default {
  getTeacherList(page, size, teacherQuery) {
    return request({
      url: `/eduservice/teacher/pageTeacherCondition/${page}/${size}`, //插值
      method: 'post',
      // teacherQuery条件对象，后端使用 RequestBody获取数据
      //data表示把对象转换json进行传递到接口里面
      data: teacherQuery
    })
  },
  deleteById(id) {
    return request({
      url: `/eduservice/teacher/delete/${id}`, 
      method: 'delete'
    })
  },
  saveTeacher(teacher) {
    return request({
      url: `/eduservice/teacher/addTeacher`, 
      method: 'post',
      data: teacher
    })
  },
  //根据id获取老师信息
  getTeacherInfo(id) {
    return request({
      url: `/eduservice/teacher/getTeacherById/${id}`,
      method: 'get'
    })
  },
  //修改数据
  updateTeacherInfo(teacher) {
    return request({
      url: `/eduservice/teacher/update`,
      method: 'post',
      data: teacher
    })
  }
}
